package com.wkbb.sports.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class JumpClassSummaryDto {
	
	
	@ApiModelProperty(value ="班级ID" )
	private Long classId;
	
	@ApiModelProperty(value ="男生人数" )
	private Integer male;
	
	@ApiModelProperty(value ="女生人数" )
	private Integer female;
	
	@ApiModelProperty(value ="男生最大次数" )
	private Integer maleMaxCount;
	
	@ApiModelProperty(value ="男生最小次数" )
	private Integer maleMinCount;
	
	@ApiModelProperty(value ="男生总次数" )
	private Integer maleTotalCount;
	
	@ApiModelProperty(value ="女生最大次数" )
	private Integer femaleMaxCount;
	
	@ApiModelProperty(value ="女生最小次数" )
	private Integer femaleMinCount;
	
	@ApiModelProperty(value ="女生总次数" )
	private Integer femaleTotalCount;
	
	@ApiModelProperty(value ="最小次数" )
	public Integer getMinCount() {
		return maleMinCount + femaleMinCount;
	}

	@ApiModelProperty(value ="最大次数" )
	public Integer getMaxCount() {
		return maleMaxCount + femaleMaxCount;
	}

	@ApiModelProperty(value ="总次数" )
	public Integer getTotalCount() {
		return maleTotalCount + femaleTotalCount;
	}

	public double getMaleAvgCount() {
		double total = getMaleTotalCount();
		return total / getMale();
	}

	public double getFemaleAvgCount() {
		double total = getFemaleTotalCount();
		return total / getFemale();
	}

	public double getAvgCount() {
		double total = getFemaleTotalCount() + getMaleTotalCount();
		return total / (getFemale() + getMale());
	}
}
